home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / DupFind_v22060774162007.psc / file 2 / Form1.frm < prev    next >
Text File  |  2007-04-15  |  37KB  |  1,327 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  4. Begin VB.Form Form1 
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "DupFind"
  7.    ClientHeight    =   3540
  8.    ClientLeft      =   150
  9.    ClientTop       =   840
  10.    ClientWidth     =   9675
  11.    Icon            =   "Form1.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   3540
  16.    ScaleWidth      =   9675
  17.    StartUpPosition =   3  'Windows Default
  18.    Begin VB.ListBox List1 
  19.       Height          =   1425
  20.       Left            =   6600
  21.       TabIndex        =   19
  22.       Top             =   1320
  23.       Width           =   2655
  24.    End
  25.    Begin MSComDlg.CommonDialog CommonDialog1 
  26.       Left            =   9600
  27.       Top             =   1560
  28.       _ExtentX        =   847
  29.       _ExtentY        =   847
  30.       _Version        =   393216
  31.       DialogTitle     =   "Export List"
  32.       Filter          =   "Text Files *.txt | *.txt"
  33.    End
  34.    Begin VB.CommandButton Command2 
  35.       Caption         =   "Stop Search"
  36.       Enabled         =   0   'False
  37.       Height          =   375
  38.       Left            =   8235
  39.       TabIndex        =   7
  40.       Top             =   500
  41.       Width           =   1335
  42.    End
  43.    Begin MSComctlLib.ProgressBar pr1 
  44.       Height          =   255
  45.       Left            =   120
  46.       TabIndex        =   5
  47.       Top             =   3120
  48.       Width           =   9135
  49.       _ExtentX        =   16113
  50.       _ExtentY        =   450
  51.       _Version        =   393216
  52.       Appearance      =   1
  53.    End
  54.    Begin VB.CommandButton Command1 
  55.       Caption         =   "Search"
  56.       Height          =   375
  57.       Left            =   8235
  58.       TabIndex        =   4
  59.       Top             =   75
  60.       Width           =   1335
  61.    End
  62.    Begin VB.TextBox Text1 
  63.       Height          =   285
  64.       Left            =   120
  65.       TabIndex        =   3
  66.       Top             =   120
  67.       Width           =   8055
  68.    End
  69.    Begin VB.DriveListBox Drive1 
  70.       Height          =   315
  71.       Left            =   120
  72.       TabIndex        =   2
  73.       Top             =   480
  74.       Width           =   2775
  75.    End
  76.    Begin VB.DirListBox Dir1 
  77.       Height          =   1440
  78.       Left            =   120
  79.       TabIndex        =   1
  80.       Top             =   1320
  81.       Width           =   3495
  82.    End
  83.    Begin VB.FileListBox File1 
  84.       Height          =   1455
  85.       Left            =   3720
  86.       ReadOnly        =   0   'False
  87.       TabIndex        =   0
  88.       Top             =   1320
  89.       Width           =   2775
  90.    End
  91.    Begin VB.Label Label12 
  92.       Caption         =   "0 files per minute"
  93.       Height          =   255
  94.       Left            =   6120
  95.       TabIndex        =   18
  96.       Top             =   720
  97.       Width           =   2055
  98.    End
  99.    Begin VB.Label Label11 
  100.       Caption         =   "Rate:"
  101.       Height          =   255
  102.       Left            =   5520
  103.       TabIndex        =   17
  104.       Top             =   720
  105.       Width           =   1215
  106.    End
  107.    Begin VB.Label Label10 
  108.       Caption         =   "0s"
  109.       Height          =   255
  110.       Left            =   4320
  111.       TabIndex        =   16
  112.       Top             =   720
  113.       Width           =   1095
  114.    End
  115.    Begin VB.Label Label9 
  116.       Caption         =   "Elapsed time:"
  117.       Height          =   255
  118.       Left            =   3000
  119.       TabIndex        =   15
  120.       Top             =   720
  121.       Width           =   1215
  122.    End
  123.    Begin VB.Label Label8 
  124.       Caption         =   "0"
  125.       Height          =   255
  126.       Left            =   6960
  127.       TabIndex        =   14
  128.       Top             =   480
  129.       Width           =   1095
  130.    End
  131.    Begin VB.Label Label7 
  132.       Caption         =   "Folders Searched"
  133.       Height          =   255
  134.       Left            =   5520
  135.       TabIndex        =   13
  136.       Top             =   480
  137.       Width           =   1455
  138.    End
  139.    Begin VB.Label Label6 
  140.       Caption         =   "0"
  141.       Height          =   255
  142.       Left            =   4320
  143.       TabIndex        =   12
  144.       Top             =   480
  145.       Width           =   1095
  146.    End
  147.    Begin VB.Label Label5 
  148.       Caption         =   "Files found so far:"
  149.       Height          =   255
  150.       Left            =   3000
  151.       TabIndex        =   11
  152.       Top             =   480
  153.       Width           =   1335
  154.    End
  155.    Begin VB.Label Label4 
  156.       Caption         =   "Searched folders"
  157.       Height          =   255
  158.       Left            =   6600
  159.       TabIndex        =   10
  160.       Top             =   1080
  161.       Width           =   2655
  162.    End
  163.    Begin VB.Label Label3 
  164.       Caption         =   "Files being searched"
  165.       Height          =   255
  166.       Left            =   3720
  167.       TabIndex        =   9
  168.       Top             =   1080
  169.       Width           =   2775
  170.    End
  171.    Begin VB.Label Label2 
  172.       Caption         =   "Current folder being searched"
  173.       Height          =   255
  174.       Left            =   120
  175.       TabIndex        =   8
  176.       Top             =   1080
  177.       Width           =   3495
  178.    End
  179.    Begin VB.Label Label1 
  180.       Height          =   255
  181.       Left            =   120
  182.       TabIndex        =   6
  183.       Top             =   2880
  184.       Width           =   9120
  185.    End
  186.    Begin VB.Menu mnuFile 
  187.       Caption         =   "File"
  188.       Begin VB.Menu mnucopnon 
  189.          Caption         =   "Copy Non-Duplicates"
  190.       End
  191.       Begin VB.Menu mnucopdup 
  192.          Caption         =   "Copy Duplicates"
  193.       End
  194.       Begin VB.Menu mnuOOE 
  195.          Caption         =   "Copy One of each duplicate and all non-duplicates"
  196.       End
  197.       Begin VB.Menu mnumovnon 
  198.          Caption         =   "Move Non-Duplicates"
  199.       End
  200.       Begin VB.Menu movdup 
  201.          Caption         =   "Move Duplicates"
  202.       End
  203.       Begin VB.Menu mnud4 
  204.          Caption         =   "-"
  205.       End
  206.       Begin VB.Menu mnudeldup 
  207.          Caption         =   "Delete Duplicates"
  208.       End
  209.       Begin VB.Menu mnudelnon 
  210.          Caption         =   "Delete Non-Duplicates"
  211.       End
  212.       Begin VB.Menu mnud2 
  213.          Caption         =   "-"
  214.       End
  215.       Begin VB.Menu mnuexit 
  216.          Caption         =   "Exit"
  217.       End
  218.    End
  219.    Begin VB.Menu mnutools 
  220.       Caption         =   "Tools"
  221.       Begin VB.Menu mnuerr 
  222.          Caption         =   "Export error log"
  223.       End
  224.       Begin VB.Menu mnuexpff 
  225.          Caption         =   "Export files found list"
  226.       End
  227.       Begin VB.Menu mnuexpdf 
  228.          Caption         =   "Export duplicate file list"
  229.       End
  230.       Begin VB.Menu mnunond 
  231.          Caption         =   "Export non-duplicate file list"
  232.       End
  233.       Begin VB.Menu mnud3 
  234.          Caption         =   "-"
  235.       End
  236.       Begin VB.Menu mnuviewnon 
  237.          Caption         =   "View non-duplicate file list"
  238.       End
  239.       Begin VB.Menu mnuviewdup 
  240.          Caption         =   "View duplicate file list"
  241.       End
  242.       Begin VB.Menu dsh2 
  243.          Caption         =   "-"
  244.       End
  245.       Begin VB.Menu mnusss 
  246.          Caption         =   "Show Search Summary"
  247.          Enabled         =   0   'False
  248.       End
  249.       Begin VB.Menu mnud 
  250.          Caption         =   "-"
  251.       End
  252.       Begin VB.Menu mnuopt 
  253.          Caption         =   "Options"
  254.       End
  255.    End
  256.    Begin VB.Menu mnusearch 
  257.       Caption         =   "Search"
  258.       Begin VB.Menu mnustrt 
  259.          Caption         =   "Start Search"
  260.       End
  261.       Begin VB.Menu mnustop 
  262.          Caption         =   "Stop Search"
  263.       End
  264.       Begin VB.Menu mnupause 
  265.          Caption         =   "Pause"
  266.       End
  267.       Begin VB.Menu dsh 
  268.          Caption         =   "-"
  269.       End
  270.       Begin VB.Menu much 
  271.          Caption         =   "Choose search folders"
  272.       End
  273.    End
  274. End
  275. Attribute VB_Name = "Form1"
  276. Attribute VB_GlobalNameSpace = False
  277. Attribute VB_Creatable = False
  278. Attribute VB_PredeclaredId = True
  279. Attribute VB_Exposed = False
  280. Option Explicit
  281. Private Declare Function GetTickCount Lib "kernel32" () As Long
  282. Private Type mSearchResult
  283. Filename    As String
  284. FileSize    As Single
  285. IsDuplicate As Boolean
  286.  
  287. End Type
  288.  
  289. Private Type mSearchResult2
  290. Filename        As String
  291. FileSize        As Single
  292. DuplicateNum    As Long
  293. End Type
  294. Private Type mCopyList
  295. mFileName As String
  296. End Type
  297.  
  298. Dim ErrorCount          As Long
  299. Dim ErrorMessage        As String
  300. Dim PauseSearch         As Boolean
  301. Dim mCopyFile(900001)   As mCopyList
  302. Dim ttc                 As Long
  303. Dim mSearchCount        As Long
  304. Dim mSearchRs(900001)   As mSearchResult
  305. Dim mDuplicate(900001)  As mSearchResult2
  306. Dim mDupCount           As Long
  307. Dim mDupGroupCount      As Long
  308. Dim StopSearch          As Boolean
  309.  
  310. Private Function NonDupAction(Action As Integer)
  311. On Error GoTo errtrap
  312. Dim PathToCopy As String
  313. Dim i, ind, CopyErrorCount As Long
  314. Dim CopyFile As String
  315. Dim CopyWholeFileName As String
  316. Dim CopyFileEXT As String
  317. Dim CopyFileName As String
  318. Dim EndFileName As String
  319. Dim strIND
  320. If Action = 3 Then
  321. Form2.Show
  322.  
  323. Form2.List1.Clear
  324. PathToCopy = "Somefakevalue"
  325. Else
  326. PathToCopy = Browse(Me.hwnd, "Select destination folder")
  327. End If
  328. If PathToCopy = "" Then Exit Function
  329. pr1.Max = 100
  330. PathToCopy = AddSlash(PathToCopy)
  331.  
  332. For i = 0 To mSearchCount
  333. pr1.Value = (100 / mSearchCount) * i
  334. If mSearchRs(i).IsDuplicate = True Then GoTo mNext
  335. CopyFile = mSearchRs(i).Filename
  336.     CopyWholeFileName = GetFileName(CopyFile)
  337.          GetFileEXT CopyWholeFileName, CopyFileName, CopyFileEXT
  338.  
  339. If CopyFile = "" Then GoTo mNext
  340. Retry:
  341. If ind <> 0 Then strIND = " " + "(" + Str(ind) + ")" Else strIND = ""
  342. EndFileName = PathToCopy + CopyFileName + strIND + CopyFileEXT
  343. If Dir(EndFileName) Then ind = ind + 1: GoTo Retry Else ind = 0
  344. Select Case Action
  345. Case 1
  346. FileCopy CopyFile, EndFileName
  347. Case 2
  348. Name CopyFile As EndFileName
  349. Case 3
  350. Form2.List1.AddItem CopyFile
  351. End Select
  352. mNext:
  353. 'temp = GetTickCount()
  354.  
  355. If CP = True Then DoEvents
  356.  
  357. 'aft = GetTickCount()
  358. 'd = d + (aft - temp)
  359. Next
  360. Dim errstring As String
  361. Dim errmes As String
  362. errstring = "Errors: %"
  363. MsgBox Replace(errstring, "%", Str(CopyErrorCount)) + errmes
  364. pr1.Value = 0
  365. Exit Function
  366. errtrap:
  367.  
  368. CopyErrorCount = CopyErrorCount + 1
  369. errmes = errmes + vbCrLf + Err.Description
  370. Err.Clear
  371. Resume Next
  372.  
  373. End Function
  374.  
  375. Private Function DuplicateAction(Action As Integer)
  376. On Error GoTo errtrap
  377. Dim PathToCopy          As String
  378. Dim i                   As Long
  379. Dim ind                 As Long
  380. Dim dupnum              As Long
  381. Dim CopyErrorCount      As Long
  382. Dim CopyFile            As String
  383. Dim CopyWholeFileName   As String
  384. Dim CopyFileEXT         As String
  385. Dim CopyFileName        As String
  386. Dim EndFileName         As String
  387. Dim strIND              As String
  388. Dim OldDup              As Integer
  389. OldDup = -1
  390. If Action = 3 Then
  391. Form2.List1.Clear
  392. Form2.Show
  393.  
  394. PathToCopy = "Somefakevalue"
  395. Else
  396. PathToCopy = Browse(Me.hwnd, "Select destination folder")
  397. End If
  398. If PathToCopy = "" Then Exit Function
  399. PathToCopy = AddSlash(PathToCopy)
  400. pr1.Max = 100
  401. For i = 0 To mDupCount
  402.     pr1.Value = (100 / mDupCount) * i
  403.  
  404.     CopyFile = mDuplicate(i).Filename
  405.     CopyWholeFileName = GetFileName(CopyFile)
  406.     GetFileEXT CopyWholeFileName, CopyFileName, CopyFileEXT
  407.     dupnum = mDuplicate(i).DuplicateNum
  408.     If CopyFile = "" Then GoTo mNext
  409. Retry:
  410.     If ind <> 0 Then strIND = " " + "(" + Str(ind) + ")" Else strIND = ""
  411.     EndFileName = PathToCopy + Str(dupnum) + " " + CopyFileName + strIND + CopyFileEXT
  412.     If Dir(EndFileName) Then ind = ind + 1: GoTo Retry Else ind = 0
  413.     
  414.     Select Case Action
  415.     Case 1
  416.     FileCopy CopyFile, EndFileName
  417.     Case 2
  418.     Name CopyFile As EndFileName
  419.     Case 3
  420.     Load Form2
  421.     If dupnum <> OldDup Then
  422.     Form2.List1.AddItem "Group " + Trim(Str(dupnum)) + " File size: " + Str(mDuplicate(i).FileSize)
  423.     OldDup = dupnum
  424.     End If
  425.     Form2.List1.AddItem (CopyFile)
  426.     End Select
  427. mNext:
  428. Next
  429. Dim errstring As String
  430. Dim errmes As String
  431. errstring = "Errors: %" ' Unneccesary
  432. MsgBox Replace(errstring, "%", Str(CopyErrorCount)) + errmes
  433. pr1.Value = 0
  434. Exit Function
  435. errtrap:
  436.  
  437. CopyErrorCount = CopyErrorCount + 1
  438. errmes = errmes + vbCrLf + Err.Description
  439. Err.Clear
  440. Resume Next
  441. End Function
  442. Private Function Swap(first As Long, Second As Long)
  443. Dim bufn As String
  444. Dim bufs As Single
  445.  
  446. bufs = mSearchRs(first).FileSize
  447. bufn = mSearchRs(first).Filename
  448. mSearchRs(first).Filename = mSearchRs(Second).Filename
  449. mSearchRs(first).FileSize = mSearchRs(Second).FileSize
  450. mSearchRs(Second).Filename = bufn
  451. mSearchRs(Second).FileSize = bufs
  452. End Function
  453. Private Function GetTimeFromSeconds(Seconds As Long) As String
  454. Dim Minutes As Integer
  455. Dim Hours   As Integer
  456. If Seconds > 59 Then
  457.     Minutes = Int(Seconds \ 60)
  458.     Seconds = Seconds - Int(Seconds \ 60) * 60
  459. Else
  460.     GetTimeFromSeconds = Trim(Str(Seconds)) + "s"
  461.     Exit Function
  462. End If
  463. If Minutes > 59 Then
  464.     Hours = Int(Minutes / 60)
  465.     Minutes = Minutes - Int(Minutes / 60) * 60
  466. Else
  467.     GetTimeFromSeconds = Trim(Str(Minutes)) + "m " + Trim(Str(Seconds)) + "s"
  468.     Exit Function
  469. End If
  470. GetTimeFromSeconds = Trim(Str(Hours)) + "h " + Trim(Str(Minutes)) + "m " + Trim(Str(Seconds)) + "s"
  471.  
  472.  
  473. End Function
  474.  
  475.  
  476.  
  477.  
  478. Private Sub FindDup(ResultCount As Long, d As Long)
  479. On Error GoTo errortrap
  480. Dim sof As Long
  481.     sof = GetTickCount()
  482. Dim temp      As Long
  483. Dim dupfound  As Boolean
  484. Dim aft       As Long
  485. Dim mrate     As Long
  486. Dim cnt       As Long
  487. Dim location1 As Long
  488. Dim Crnt      As Long
  489. Dim i         As Long
  490. Dim f         As Long
  491. Dim r         As Long
  492. Dim j         As Long
  493. Dim u         As Long
  494. Dim bufs      As Single
  495. Dim Byt1      As Byte
  496. Dim Byt2      As Byte
  497. Dim fn        As Long
  498. Dim fn2       As Long
  499. Dim IsDup     As Boolean
  500. Dim dupnum    As Long
  501. Dim pls       As Long
  502. Dim fcf       As Long
  503. Dim ifs       As Single
  504. Dim ipp       As Single
  505. Dim ifn       As String
  506. Dim ipf       As String
  507.  
  508. ErrorMessage = ""
  509. Crnt = -1
  510. dupnum = -1
  511. ErrorCount = -1
  512. mDupGroupCount = -1
  513. pr1.Max = 100
  514. Label1.Caption = "Arranging Files"
  515. ' Start of sort Start of sort Start of sort Start of sort Start of sort Start of sort Start of sort Start of sort Start of sort
  516. Sort 0, mSearchCount, d
  517. ' end of sort
  518. i = -1
  519. pr1.Max = 100
  520. sof = GetTickCount()
  521. Dim exin As Long
  522. Label1.Caption = "Finding duplicate files"
  523. Do
  524.  
  525.     cnt = GetTickCount()
  526.     If cnt - sof <> 0 Then
  527.    ' calculate the file rate
  528.         mrate = Int((i + pls) / (((cnt - sof) / 1000) / 60)) ' here again --------------------------
  529.         'If avgcon > 100 Then
  530.         'avgtot = avgtot + mrate
  531.         'avgcon = avgcon + 1
  532.         'avgr = avgtot / avgcon
  533.         'mrate = avgr
  534.         'End If
  535.         'If mrate <> 0 Then
  536.         'exin = (mSearchCount / (mrate / 60)) - r
  537.         'If Int(exin) < 0 Then exin = 0
  538.  
  539.  
  540.         'Label1.Caption = "Finding duplicate files: Estimated completion time: " _
  541.           + GetTimeFromSeconds(mSearchCount / (mrate / 60)) + _
  542.            " Estimated time left: " + GetTimeFromSeconds(exin)
  543.         'End If
  544.     End If
  545.     Label12.Caption = Str(mrate) + " Files per min"
  546.     If PauseSearch = True Then
  547.         temp = GetTickCount()
  548.         MsgBox "Press Ok to continue the search"
  549.         PauseSearch = False
  550.         aft = GetTickCount()
  551.         d = d + (aft - temp)
  552.     End If
  553.     f = GetTickCount()
  554.     r = (f - d) / 1000
  555.     Label10.Caption = GetTimeFromSeconds(r)
  556.     i = i + 1
  557.     If i > ResultCount Then Exit Do
  558.         pls = 1
  559.         pr1.Value = (100 / (ResultCount + 1)) * i
  560. 'next search result
  561. NSR:
  562.  
  563.     ifs = mSearchRs(i).FileSize
  564.     ipp = mSearchRs(i + pls).FileSize
  565.     ifn = mSearchRs(i).Filename
  566.     ipf = mSearchRs(i + pls).Filename
  567.     ' if the files are zero size and the zero byte option is on
  568.     ' automaticly set them as duplicates
  569.     If ifs = 0 And ipp = 0 And (i + pls) <= ResultCount And ipf <> ifn Then IsDup = ZBFAD: GoTo ZeroSize
  570.     ' if they are teh same size goto byte checking
  571.     If ifs = ipp And (i + pls) <= ResultCount And ipf <> ifn Then
  572.         CurrentType = 1 ' starting pattern byte checking
  573.         'through the number of bytes selected in teh options
  574. ByteComparison:
  575.         If CurrentType = 1 Then
  576.         ' if the file size is smaller than the number of
  577.         ' bytes then just search the whole file
  578.             If mSearchRs(i).FileSize < NOB Then
  579.                 NoOfTimes = mSearchRs(i).FileSize
  580.                 CurrentType = 2
  581.             Else
  582.                 NoOfTimes = NOB
  583.             End If
  584.         End If
  585.         ' set the values so that the error log knows
  586.         ' which file the error happened on
  587.         fcf = i
  588.         fn = FreeFile
  589.         If Dir(mSearchRs(i).Filename) = False Then GoTo ZeroSize
  590.         If Dir(mSearchRs(i + pls).Filename) = False Then GoTo ZeroSize
  591.         Open mSearchRs(i).Filename For Binary As fn
  592.         fcf = i + pls
  593.         fn2 = FreeFile
  594.         Open mSearchRs(i + pls).Filename For Binary As fn2
  595.         'compare the bytes
  596.         For j = 1 To NoOfTimes
  597.             IsDup = True
  598.   
  599.             If CP = True Then DoEvents
  600.             
  601.             If mSearchRs(i).FileSize <> 0 Then
  602.                 If CurrentType = 1 Then
  603.                 'calculate the location in the file to check
  604.                     location1 = Int((mSearchRs(i).FileSize / NoOfTimes) * j)
  605.                     If location1 = 0 Then location1 = 1
  606.                     'check the location wasnt put to
  607.                     ' high because of the int function
  608.                     If location1 > mSearchRs(i).FileSize Then location1 = mSearchRs(i).FileSize
  609.                 Else
  610.                     location1 = j
  611.                 End If
  612.    
  613.             End If
  614.     
  615.             fcf = i
  616.             Get #fn, location1, Byt1
  617.             fcf = i + pls
  618.             Get #fn2, location1, Byt2
  619.             ' compare the two bytes
  620.             If Byt2 <> Byt1 Then IsDup = False: Exit For
  621.                  
  622.         Next
  623.         Close #fn
  624.         Close #fn2
  625.     Else
  626.         IsDup = False
  627.     End If
  628.    ' if the file is zero size the program will skip to here
  629. ZeroSize:
  630.     If IsDup = True Then
  631.         If CurrentType = 1 Then CurrentType = 2: GoTo ByteComparison
  632.         dupfound = True
  633.         'set the index for the next file to be checked
  634.         pls = pls + 1
  635.         ' look through the files again
  636.         GoTo NSR
  637.     ' if it wasnt a duplicate
  638.     Else
  639.     ' but if there was a duplicate group
  640.         If dupfound = True Then
  641.             dupfound = False
  642.             'increment the duplicate group num
  643.             dupnum = dupnum + 1
  644.             'add them to the duplicate file array
  645.             For u = i To (i + pls - 1) '
  646.                 Crnt = Crnt + 1
  647.                 mDuplicate(Crnt).Filename = mSearchRs(u).Filename
  648.                 mDuplicate(Crnt).FileSize = mSearchRs(u).FileSize
  649.                 mDuplicate(Crnt).DuplicateNum = dupnum
  650.                 mSearchRs(u).IsDuplicate = True
  651.             Next
  652.             i = i + (pls - 1)
  653.         Else
  654.             mSearchRs(u).IsDuplicate = False
  655.         End If
  656.     End If
  657.     If CP = True Then DoEvents
  658.  
  659. Loop
  660. mDupCount = Crnt
  661. mDupGroupCount = dupnum
  662. Label1.Caption = ""
  663. Exit Sub
  664. errortrap:
  665. ErrorCount = ErrorCount + 1
  666. ErrorMessage = ErrorMessage + vbCrLf + "Error " + Trim(Str(Err.Number)) + vbCrLf + Err.Description + vbCrLf + "File: " + mSearchRs(fcf).Filename
  667.  
  668. Resume Next
  669. End Sub
  670.  
  671. Private Sub Command1_Click()
  672. File1.Refresh
  673. 'check for search folders
  674. If SFC = -1 Then MsgBox "Please choose at least 1 directory to search": Exit Sub
  675. On Error GoTo errtrap
  676. Dim d As Long
  677. 'reset progress bar
  678. pr1.Value = 0
  679. 'set timer
  680. d = GetTickCount()
  681. 'clear search folder list
  682. List1.Clear
  683. ' declare variables
  684. Dim DLI     As String
  685. Dim cbf     As String
  686. Dim g       As String
  687. Dim temprs  As String
  688. Dim temp    As Single
  689. Dim aft     As Single
  690. Dim FCount  As Long
  691. Dim Result  As Long
  692. Dim ret     As Integer
  693. Dim A       As Integer
  694. Dim c       As Long
  695. Dim i       As Long
  696. Dim z       As Long
  697. Dim f       As Long
  698. Dim r       As Long
  699. Dim o       As Integer
  700. Dim l1      As String
  701. 'set the result count to -1
  702. Result = -1
  703. 'add all search folders to the list
  704. For i = 0 To SFC
  705.     If SearchFolder(i).Used = True Then
  706.         List1.AddItem SearchFolder(i).FolderPath
  707.     End If
  708. Next
  709. If List1.ListCount = 0 Then MsgBox "Please choose at least 1 directory to search": Exit Sub
  710. ' set path
  711. Dir1.Path = List1.List(0)
  712. 'disable and enable controls
  713. mnuFile.Enabled = False
  714. mnusss.Enabled = False
  715. mnupause.Enabled = True
  716. Text1.Enabled = False  'Search Keywords
  717.   'Bit Checks
  718. Drive1.Enabled = False
  719. Dir1.Enabled = False
  720. File1.Enabled = False
  721. List1.Enabled = False
  722. mnuopt.Enabled = False
  723. Command2.Enabled = True
  724. Command1.Enabled = False 'Search Button
  725. mnustrt.Enabled = False
  726. mnustop.Enabled = True
  727. ' search for files loop
  728.  
  729. Do
  730.     If PauseSearch = True Then
  731.         temp = GetTickCount() ' pause timer
  732.         MsgBox "Press Ok to continue the search"
  733.         PauseSearch = False
  734.         aft = GetTickCount()
  735.         d = d + (aft - temp)
  736.     End If
  737.     If StopSearch = True Then
  738.  
  739.         temp = GetTickCount()
  740.         A = MsgBox("Do you want to stop the search? " + Str(Result + 1) + " Results Found", vbYesNo)
  741.         aft = GetTickCount()
  742.         d = d + (aft - temp)
  743.         If A = vbNo Then
  744.             StopSearch = False
  745.         Else
  746.             StopSearch = False: Exit Do
  747.         End If
  748.     End If
  749.     Dir1.Path = List1.List(z)
  750.     FCount = FCount + 1
  751.     Label8.Caption = Trim(Str(FCount))
  752.     ' add the files in that directory to the files found array
  753.     For c = 0 To File1.ListCount - 1
  754.         f = GetTickCount()
  755.         r = (f - d) / 1000
  756.         Label10.Caption = GetTimeFromSeconds(r)
  757.         If InStr(1, File1.List(c), Text1) <> 0 Then
  758.             Result = Result + 1
  759.             Label6.Caption = Trim(Str(Result + 1))
  760.             g = AddSlash(Dir1.Path)
  761.             mSearchRs(Result).Filename = g + File1.List(c)
  762.             mSearchRs(Result).FileSize = FileLen(g + File1.List(c))
  763.             If Result + 1 >= Maxr And Maxr <> 0 Then Exit Do
  764.         End If
  765.     Next
  766.     If SSD = True Then ' S-earch S-ub D-irectories
  767.         For i = 0 To Dir1.ListCount - 1
  768.             DLI = LCase(AddSlash(Dir1.List(i)))
  769.             ' banned folder check -----------------------------------------------
  770.             For o = 0 To BFC
  771.                 cbf = LCase(BannedFolder(o).FolderPath)
  772.                 l1 = Left(DLI, Len(cbf))
  773.                 If Len(DLI) >= Len(cbf) And BannedFolder(o).Used = True Then
  774.                     If l1 = cbf Then
  775.                         GoTo IsBanned
  776.                     End If
  777.                 End If
  778.             Next
  779.  
  780.             List1.AddItem DLI
  781. IsBanned:
  782.         Next
  783.     End If
  784.     z = z + 1
  785.     If z = List1.ListCount Then Exit Do
  786.     If CP = True Then DoEvents ' crash protection
  787. Loop
  788. mSearchCount = Result
  789. Command2.Enabled = False
  790. mnustop.Enabled = False
  791. ' Find Duplicates Here
  792. If AskPerm = True Then
  793.     temprs = Trim(Str(mSearchCount + 1)) + " Results found, "
  794.     temp = GetTickCount()
  795.     ret = MsgBox("Do you want to find duplicates?", vbYesNo)
  796.     aft = GetTickCount()
  797.     d = d + (aft - temp)
  798. Else
  799.     ret = vbYes
  800. End If
  801. If ret = vbYes Then
  802.     FindDup mSearchCount, d
  803. Else
  804.     mDupCount = -1
  805.     mDupGroupCount = -1
  806.     ErrorCount = -1
  807.     ErrorMessage = ""
  808. End If
  809. f = GetTickCount()
  810. r = (f - d) / 1000
  811. Text1.Enabled = True  'Search Keywords
  812.  
  813. Drive1.Enabled = True
  814. Dir1.Enabled = True
  815. File1.Enabled = True
  816. List1.Enabled = True
  817. Command1.Enabled = True 'Search Button
  818. mnustrt.Enabled = True
  819.  
  820. ttc = r ' time to complete
  821. MsgBox "Search Complete " + vbCrLf + "Summary: " + vbCrLf + _
  822.  Str(Result + 1) + " Matches " + vbCrLf + Str(mDupCount + 1) _
  823.  + " Duplicates Found In " + GetTimeFromSeconds(r) + vbCrLf + Str(mDupGroupCount + 1) + " Duplicate Groups" + vbCrLf + Str(ErrorCount + 1) + " Errors "
  824. mnuopt.Enabled = True
  825. mnuFile.Enabled = True
  826. mnusss.Enabled = True
  827. mnupause.Enabled = False
  828. pr1.Value = 0
  829. Exit Sub
  830. errtrap:
  831. ErrorMessage = ErrorMessage + "Error: " + Str(Err.Number) + " " + Err.Description
  832. ErrorCount = ErrorCount + 1
  833. Resume Next
  834. End Sub
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842. Private Sub Command2_Click()
  843.  
  844. StopSearch = True
  845. End Sub
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853. Private Sub Dir1_Change()
  854. On Error GoTo errtrap
  855. File1.Path = Dir1.Path
  856. Exit Sub
  857. errtrap:
  858. MsgBox "Error: " + Str(Err.Number) + " " + Err.Description, vbCritical
  859.  
  860. End Sub
  861.  
  862. Private Sub Drive1_Change()
  863. On Error GoTo errtrap
  864. Dir1.Path = Drive1.List(Drive1.ListIndex)
  865. Exit Sub
  866. errtrap:
  867. MsgBox "Error: " + Str(Err.Number) + " " + Err.Description, vbCritical
  868.  
  869. End Sub
  870.  
  871. Private Sub Form_Load()
  872. On Error Resume Next
  873. SFC = -1
  874. BFC = -1
  875. SendMessage List1.hwnd, LB_SETHORIZONTALEXTENT, 1000, 0
  876.  
  877.  
  878. ZBFAD = True
  879. NOB = 50
  880. CP = True
  881. Maxr = 50000
  882.  
  883. mSearchCount = -1
  884. File1.Pattern = "*.*"
  885. Form1.Show
  886. Form3.Show 1
  887. Form6.Show 1
  888. End Sub
  889.  
  890. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  891. Cancel = 1
  892. End
  893. End Sub
  894.  
  895.  
  896.  
  897. Private Sub mnucopdup_Click()
  898. DuplicateAction 1
  899. End Sub
  900.  
  901. Private Sub mnucopnon_Click()
  902. NonDupAction 1
  903. End Sub
  904. Private Sub mnudeldup_Click()
  905. On Error GoTo errtrap
  906. Dim i As Long
  907. Dim A As String
  908. Dim errCount As Long
  909. Dim errmes As String
  910. A = InputBox("Are you sure you want to delete all duplicates? Type 'delete' to continue")
  911. If A <> "delete" Then MsgBox "No files deleted": Exit Sub
  912. pr1.Max = 100
  913.  
  914. For i = 0 To mDupCount
  915. pr1.Value = (100 / mDupCount) * i
  916. Kill mDuplicate(i).Filename
  917. Next
  918. MsgBox "Errors: " + Str(errCount) + errmes
  919. pr1.Value = 0
  920. Exit Sub
  921. errtrap:
  922. errCount = errCount + 1
  923. errmes = errmes + vbCrLf + Err.Description
  924. Resume Next
  925. End Sub
  926.  
  927. Private Sub mnudelnon_Click()
  928. On Error GoTo errtrap
  929. Dim i As Long
  930. Dim A As String
  931. Dim errCount As Long
  932. Dim errmes As String
  933. A = InputBox("Are you sure you want to delete all non-duplicates? Type 'delete' to continue")
  934. If A <> "delete" Then MsgBox "No files deleted": Exit Sub
  935. pr1.Max = 100
  936.  
  937. For i = 0 To mSearchCount
  938. pr1.Value = (100 / mSearchCount) * i
  939. If mSearchRs(i).IsDuplicate = False Then
  940. Kill mSearchRs(i).Filename
  941. End If
  942. Next
  943. MsgBox "Errors: " + Str(errCount) + errmes
  944. pr1.Value = 0
  945. Exit Sub
  946. errtrap:
  947. errCount = errCount + 1
  948. errmes = errmes + vbCrLf + Err.Description
  949. Resume Next
  950. End Sub
  951.  
  952. Private Sub mnuerr_Click()
  953. Form5.Check1.Enabled = False
  954. Form5.Check1.Value = vbUnchecked
  955. Form5.Show 1
  956. Form5.Check1.Enabled = True
  957. Dim clist As String
  958. Dim fnum As Long
  959. clist = ErrorMessage
  960. If BPressed = 2 Then Exit Sub
  961.  If TypeOfCopy = 1 Then Clipboard.Clear: Clipboard.SetText clist: MsgBox "Error log copied to clipboard succesfully"
  962.     ' if it is to export to file
  963.     If TypeOfCopy = 2 Then
  964.             CommonDialog1.ShowSave
  965.             If CommonDialog1.Filename = "" Then Exit Sub
  966.             fnum = FreeFile
  967.             Open CommonDialog1.Filename For Output As fnum
  968.             Print #fnum, clist
  969.             Close #fnum
  970.             MsgBox "Error log saved succesfully to: " + CommonDialog1.Filename
  971.             
  972.     End If
  973.     pr1.Value = 0
  974. Exit Sub
  975. errtrap:
  976. MsgBox "An unexpected error has accured make sure the disk is not full or write protected."
  977. Exit Sub
  978.  
  979.  
  980. End Sub
  981.  
  982. Private Sub mnuexit_Click()
  983. End
  984. End Sub
  985.  
  986. Private Sub mnuexpdf_Click()
  987. On Error GoTo errtrap
  988. ' type of copy = 1 = clipboard
  989. ' type of copy = 2 = file
  990. Dim clist As String
  991. Dim ff As String
  992. Dim oldg As Long
  993. Form5.Show 1
  994. If BPressed = 2 Then Exit Sub
  995. Dim i As Long
  996. Dim fnum As Long
  997. oldg = -1
  998. Label1.Caption = "Building list"
  999. pr1.Max = 100
  1000. For i = 0 To mDupCount
  1001.  
  1002. pr1.Value = (100 / (mDupCount)) * i
  1003. If CP = True Then DoEvents
  1004.     If FNOnly = True Then
  1005.         ff = GetFileName(mDuplicate(i).Filename)
  1006.     Else
  1007.         ff = mDuplicate(i).Filename
  1008.     End If
  1009.     
  1010. If mDuplicate(i).DuplicateNum <> oldg Then
  1011.     oldg = mDuplicate(i).DuplicateNum
  1012.     ff = "Duplicate Group: " + Trim(Str(mDuplicate(i).DuplicateNum)) + " File size: " + Trim(Str(mDuplicate(i).FileSize)) + " Bytes" + vbCrLf + "    " + ff
  1013. clist = clist + vbCrLf + ff
  1014. Else
  1015.  
  1016.   clist = clist + vbCrLf + "    " + ff
  1017.   End If
  1018.   If CP = True Then DoEvents
  1019. Next
  1020.     ' if it is to export to clipboard
  1021.     If TypeOfCopy = 1 Then Clipboard.Clear: Clipboard.SetText clist: MsgBox "Duplicate files found list copied to clipboard succesfully"
  1022.     ' if it is to export to file
  1023.     If TypeOfCopy = 2 Then
  1024.             CommonDialog1.ShowSave
  1025.             If CommonDialog1.Filename = "" Then Exit Sub
  1026.             fnum = FreeFile
  1027.             Open CommonDialog1.Filename For Output As fnum
  1028.             Print #fnum, clist
  1029.             Close #fnum
  1030.             MsgBox "Duplicate files list saved succesfully to: " + CommonDialog1.Filename
  1031.             
  1032.     End If
  1033.     pr1.Value = 0
  1034. Exit Sub
  1035. errtrap:
  1036. MsgBox "An unexpected error has accured make sure the disk is not full or write protected."
  1037. Exit Sub
  1038.  
  1039. End Sub
  1040.  
  1041. Private Sub mnuexpff_Click()
  1042. On Error GoTo errtrap
  1043. ' type of copy = 1 = clipboard
  1044. ' type of copy = 2 = file
  1045. Dim clist As String
  1046. Dim ff As String
  1047. Dim i As Long
  1048. Dim fnum As Long
  1049. Form5.Show 1
  1050. If BPressed = 2 Then Exit Sub
  1051.  
  1052.     pr1.Max = 100
  1053. For i = 0 To mSearchCount
  1054.     If FNOnly = True Then
  1055.         ff = GetFileName(mSearchRs(i).Filename)
  1056.     Else
  1057.         ff = mSearchRs(i).Filename
  1058.     End If
  1059. pr1.Value = (100 / mSearchCount) * i
  1060.         clist = clist + vbCrLf + ff
  1061.         If CP = True Then DoEvents
  1062. Next
  1063.     ' if it is to export to clipboard
  1064.     If TypeOfCopy = 1 Then Clipboard.Clear: Clipboard.SetText clist: MsgBox "Files found list copied to clipboard succesfully"
  1065.     ' if it is to export to file
  1066.     If TypeOfCopy = 2 Then
  1067.             CommonDialog1.ShowSave
  1068.             If CommonDialog1.Filename = "" Then Exit Sub
  1069.             fnum = FreeFile
  1070.             Open CommonDialog1.Filename For Output As fnum
  1071.             Print #fnum, clist
  1072.             Close #fnum
  1073.             MsgBox "Files found list saved succesfully to: " + CommonDialog1.Filename
  1074.             
  1075.     End If
  1076.     pr1.Value = 0
  1077. Exit Sub
  1078. errtrap:
  1079. MsgBox "An unexpected error has accured make sure the disk is not full or write protected."
  1080. Exit Sub
  1081.  
  1082. End Sub
  1083.  
  1084. Private Sub mnumovnon_Click()
  1085. NonDupAction 2
  1086. End Sub
  1087.  
  1088. Private Sub mnunond_Click()
  1089. On Error GoTo errtrap
  1090. ' type of copy = 1 = clipboard
  1091. ' type of copy = 2 = file
  1092. Dim clist As String
  1093. Dim ff As String
  1094. Dim i As Long
  1095. Dim fnum As Long
  1096. Form5.Show 1
  1097. pr1.Max = 100
  1098. If BPressed = 2 Then Exit Sub
  1099.  
  1100.     
  1101. For i = 0 To mSearchCount
  1102. If mSearchRs(i).IsDuplicate = False Then
  1103.     If FNOnly = True Then
  1104.         ff = GetFileName(mSearchRs(i).Filename)
  1105.     Else
  1106.         ff = mSearchRs(i).Filename
  1107.     End If
  1108.     
  1109.     clist = clist + vbCrLf + ff
  1110. Else
  1111. ff = ""
  1112. End If
  1113. pr1.Value = (100 / mSearchCount) * i
  1114. If CP = True Then DoEvents
  1115. Next
  1116.     ' if it is to export to clipboard
  1117.     If TypeOfCopy = 1 Then Clipboard.Clear: Clipboard.SetText clist: MsgBox "Non-Duplicate files list copied to clipboard succesfully"
  1118.     ' if it is to export to file
  1119.     If TypeOfCopy = 2 Then
  1120.             CommonDialog1.ShowSave
  1121.             If CommonDialog1.Filename = "" Then Exit Sub
  1122.             fnum = FreeFile
  1123.             Open CommonDialog1.Filename For Output As fnum
  1124.             Print #fnum, clist
  1125.             Close #fnum
  1126.             MsgBox "Non-Duplicate file list saved succesfully to: " + CommonDialog1.Filename
  1127.             
  1128.     End If
  1129.     pr1.Value = 0
  1130. Exit Sub
  1131. errtrap:
  1132. MsgBox "An unexpected error has accured make sure the disk is not full or write protected."
  1133. Exit Sub
  1134.  
  1135. End Sub
  1136.  
  1137. Private Sub mnuOOE_Click()
  1138. Dim CopyCount As Long
  1139. Dim i As Long
  1140. Dim lastg As Long
  1141. Dim errstring As String
  1142. CopyCount = -1
  1143. lastg = -1
  1144.  
  1145. For i = 0 To mSearchCount
  1146. If mSearchRs(i).IsDuplicate <> True Then
  1147. CopyCount = CopyCount + 1
  1148. mCopyFile(CopyCount).mFileName = mSearchRs(i).Filename
  1149.  
  1150. End If
  1151. If CP = True Then DoEvents
  1152. Next
  1153. For i = 0 To mDupCount
  1154. If CP = True Then DoEvents
  1155. If mDuplicate(i).DuplicateNum <> lastg Then
  1156. lastg = mDuplicate(i).DuplicateNum
  1157. CopyCount = CopyCount + 1
  1158. mCopyFile(CopyCount).mFileName = mDuplicate(i).Filename
  1159. End If
  1160. Next
  1161. On Error GoTo errtrap
  1162. Dim PathToCopy As String
  1163. Dim ind, CopyErrorCount As Long
  1164. Dim CopyFile As String
  1165. Dim CopyWholeFileName As String
  1166. Dim CopyFileEXT As String
  1167. Dim CopyFileName As String
  1168. Dim EndFileName As String
  1169. Dim strIND
  1170. PathToCopy = Browse(Me.hwnd, "Select destination folder")
  1171. If PathToCopy = "" Then Exit Sub
  1172.  
  1173. PathToCopy = AddSlash(PathToCopy)
  1174. pr1.Max = 100
  1175.  
  1176. For i = 0 To CopyCount
  1177. pr1.Value = (100 / CopyCount) * i
  1178.  
  1179. CopyFile = mCopyFile(i).mFileName
  1180.     CopyWholeFileName = GetFileName(CopyFile)
  1181.          GetFileEXT CopyWholeFileName, CopyFileName, CopyFileEXT
  1182.  
  1183. If CopyFile = "" Then GoTo mNext
  1184. Retry:
  1185. If ind <> 0 Then strIND = "(" + "(" + Str(ind) + ")" + ")" Else strIND = ""
  1186. EndFileName = PathToCopy + " " + CopyFileName + strIND + CopyFileEXT
  1187. If Dir(EndFileName) Then ind = ind + 1: GoTo Retry Else ind = 0
  1188. FileCopy CopyFile, EndFileName
  1189.  
  1190.  
  1191. mNext:
  1192. 'temp = GetTickCount()
  1193. DoEvents
  1194.  
  1195. 'aft = GetTickCount()
  1196. 'd = d + (aft - temp)
  1197.  
  1198.  
  1199. Next
  1200. Dim errmes As String
  1201. errstring = "Errors: %"
  1202. MsgBox Replace(errstring, "%", Str(CopyErrorCount)) + errmes
  1203. pr1.Value = 0
  1204. Exit Sub
  1205. errtrap:
  1206.  
  1207. CopyErrorCount = CopyErrorCount + 1
  1208. errmes = errmes + vbCrLf + Err.Description
  1209. Err.Clear
  1210. Resume Next
  1211. End Sub
  1212.  
  1213. Private Sub mnuopt_Click()
  1214. Load Form4
  1215. Form4.Text1 = Trim(Str(Maxr))
  1216. Form4.Text2 = File1.Pattern
  1217. Form4.Text3 = Trim(Str(NOB))
  1218. If CP = True Then
  1219. Form4.Check1.Value = vbChecked
  1220. Else
  1221. Form4.Check1.Value = vbUnchecked
  1222. End If
  1223. If ZBFAD = True Then Form4.Check2.Value = vbChecked Else Form4.Check2.Value = vbUnchecked
  1224. If AskPerm = True Then Form4.Check3.Value = vbChecked Else Form4.Check3.Value = vbUnchecked
  1225. If File1.Hidden = True Then Form4.Check4.Value = vbChecked Else Form4.Check4.Value = vbUnchecked
  1226. If File1.ReadOnly = True Then Form4.Check5.Value = vbChecked Else Form4.Check5.Value = vbUnchecked
  1227. If File1.System = True Then Form4.Check6.Value = vbChecked Else Form4.Check6.Value = vbUnchecked
  1228. Form4.Show 1
  1229. End Sub
  1230.  
  1231. Private Sub mnupause_Click()
  1232. PauseSearch = True
  1233. End Sub
  1234.  
  1235. Private Sub mnusss_Click()
  1236. MsgBox "Search Complete " + vbCrLf + "Summary: " + vbCrLf + _
  1237.  Str(mSearchCount + 1) + " Matches " + vbCrLf + Str(mDupCount + 1) _
  1238.  + " Duplicates Found In " + GetTimeFromSeconds(ttc) + vbCrLf + Str(mDupGroupCount + 1) + " Duplicate Groups" + vbCrLf + Str(ErrorCount + 1) + " Errors "
  1239. End Sub
  1240. Public Sub Sort(ByVal first As Long, ByVal last As Long, d As Long)
  1241.  
  1242. Dim r As Long
  1243. Dim i As Long
  1244. Dim f As Long
  1245.     Dim pivot As Double
  1246.   
  1247.     
  1248.     
  1249.     If first < last Then
  1250.         pivot = Partition(first, last, d)
  1251.         Sort first, pivot - 1, d
  1252.         Sort pivot + 1, last, d
  1253.     End If
  1254.         f = GetTickCount()
  1255.             r = (f - d) / 1000
  1256.             Label10.Caption = GetTimeFromSeconds(r)
  1257. End Sub
  1258.  
  1259. Public Function Partition(first As Long, ByVal last As Long, d As Long) As Double
  1260. Dim f As Long
  1261.         Dim r As Long
  1262.     Dim up As Long
  1263.     Dim down As Long
  1264.     Dim pivot As Single
  1265.         f = GetTickCount()
  1266.             r = (f - d) / 1000
  1267.             Label10.Caption = GetTimeFromSeconds(r)
  1268.     pivot = mSearchRs(first).FileSize
  1269.     up = first
  1270.     down = last
  1271.     
  1272.   
  1273.     Do While (up < down)
  1274. If CP = True Then DoEvents
  1275.        
  1276.         Do While (mSearchRs(up).FileSize <= pivot) And (up < last)
  1277.             up = up + 1
  1278.         Loop
  1279.         
  1280.         Do While (mSearchRs(down).FileSize > pivot)
  1281.             down = down - 1
  1282.         Loop
  1283.         If up < down Then Swap up, down
  1284.     Loop
  1285.     
  1286.     Swap first, down
  1287.     Partition = down
  1288. End Function
  1289.  
  1290. Private Sub mnustop_Click()
  1291. StopSearch = True
  1292. End Sub
  1293.  
  1294. Private Sub mnustrt_Click()
  1295. Command1_Click
  1296.  
  1297. End Sub
  1298.  
  1299. Private Sub mnuviewdup_Click()
  1300. DuplicateAction 3
  1301. End Sub
  1302.  
  1303. Private Sub mnuviewnon_Click()
  1304. NonDupAction 3
  1305. End Sub
  1306.  
  1307. Private Sub movdup_Click()
  1308. DuplicateAction 2
  1309. End Sub
  1310.  
  1311. Private Sub much_Click()
  1312. Load Form6
  1313. Dim i As Integer
  1314. For i = 0 To SFC
  1315. Form6.List1.AddItem SearchFolder(i).FolderPath
  1316. Form6.List1.Selected(i) = SearchFolder(i).Used
  1317. Next
  1318. For i = 0 To BFC
  1319. Form6.List2.AddItem BannedFolder(i).FolderPath
  1320. Form6.List2.Selected(i) = BannedFolder(i).Used
  1321. Next
  1322. If SSD Then Form6.Check1.Value = vbChecked Else Form6.Check1.Value = vbUnchecked
  1323. Form6.Show 1
  1324.  
  1325. End Sub
  1326.  
  1327.